<?php
/* /app/View/Helper/SearchHelper.php */
App::uses('AppHelper', 'View/Helper');

class QuickSearchHelper extends AppHelper {
	var $helpers = array('Form','Js');
	
    public function makeQuickSearch($options, $clear) {
    	
    	echo "\t\t<div id=\"search\">\n";
    	echo $this->Form->create('Search', array(
    			'id'=>'SearchIndexForm',
    			'encoding'=>'UTF-8',
    			'class' => 'search',
    			'url' => 'search/',
    		)
    	) . "\n";
    	
		echo $this->Form->input('searchType', array(
				'options' => $options,
				'empty' => '(choose one)',
				'label' => 'Search for:',
				'div' => false,
			)
		) . "\n";
		echo $this->Form->input('searchValue', array(
				'type' => 'text',
				'div' => false,
				'label' => '',
			)
		) . "\n";
		echo $this->Js->submit('Go', array(
				'update' => '#content',
				'div' => false,
				'async' => false,
				'url' => 'search/',
			)
		) . "\n";

		echo $this->Form->end() . "\n";;

		if ($clear) {
			echo $this->Js->link('clear', 'clear', array(
					'update' => '#content',
					'div' => false,
					'async' => false,
					'url' => 'clear/',
			)
			) . "\n";
		}
		echo "\t\t</div>\n";
    }
}